import Foundation
import Moya

let giphyProvider = MoyaProvider<Giphy>()

public enum Giphy {
    case upload(gif: Data)
}

extension Giphy: TargetType {
    public var baseURL: URL { return URL(string: "https://upload.giphy.com")! } // swiftlint:disable:this force_unwrapping
    public var path: String {
        switch self {
        case .upload:
            return "/v1/gifs"
        }
    }
    public var method: Moya.Method {
        switch self {
        case .upload:
            return .post
        }
    }
    public var task: Task {
        switch self {
        case let .upload(data):
            let multipartFormData = [MultipartFormData(provider: .data(data), name: "file", fileName: "gif.gif", mimeType: "image/gif")]
            return .uploadCompositeMultipart(multipartFormData, urlParameters: ["api_key": "dc6zaTOxFJmzC", "username": "Moya"])
        }
    }
    public var sampleData: Data {
        switch self {
        case .upload:
            return "{\"data\":{\"id\":\"your_new_gif_id\"},\"meta\":{\"status\":200,\"msg\":\"OK\"}}".data(using: String.Encoding.utf8)! // swiftlint:disable:this force_unwrapping
        }
    }

    public var headers: [String: String]? {
        return nil
    }

    // swiftlint:disable:next force_unwrapping
    static let animatedBirdData = Data(base64Encoded: "R0lGODlhJAAlAMMDAAAAAP/yAB0bAP///5mZmREAAHNzc/7+/hsZAP/xAPr69//0AB4bAGZmZgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFZAAOACwAAAAAJAAlAAAEY9DJSau9OOvNu/9gKI5kaZ5oqq5s675wLM90DNx3ewc8n6eAntCHCvIYjACyBzgZGYcDVEosPaOEQ5YaaJKu0jDXOwKLx9YeMrlmpofwrskYr77rcqd6aXfSfWQqOD81hYYYEQAh+QQFCgAOACwNABYACQAGAAAEDjDISau1bGaZmQ/edgURACH5BAlkAA4ALAAAAAAkACUAAAQ+0MlJq7046827/2AojmRpnmiqrmzrvnAsz3Rt3yvDOLrLHIdfkCUkHIzDFfAnJAKDz12up5PirtisdsulRQAAIfkECRQADgAsCQAQABIAFQAABHfQuSKrlRRPbTP9RhFeWGgATliIZLqy09piMg1faha/11tPhlll5DighBXAQXJEOppNBkJKRTCTDmlgy91OoQwuAuElb5vmAEI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